import request from '@/axios'
import { useOtherStoreWithOut } from '@/store/modules/other'

const otherStore = useOtherStoreWithOut()
const BASEURL = '/changhu'
const BASEURL2 = '/api'

/** 分页查询高速路段信息 */
export const highwayRoadPageDataList = (params, data) => {
  return request.post({ url: BASEURL + '/highwayRoad/pageDataList', params: params, data: data })
}

/** 新增或修改高速路段信息 */
export const highwayRoadSaveOrUpdate = (data) => {
  return request.post({ url: BASEURL + '/highwayRoad/saveOrUpdate', data: data })
}

/** 根据id删除高速路段信息 */
export const highwayRoadDeleteById = (params) => {
  return request.post({ url: BASEURL + '/highwayRoad/delete', params: params })
}

/** 查询 路段树结构列表 */
export const highwayRoadTreeList = () => {
  return request.post({
    url: BASEURL + '/highwayRoad/treeList',
    params: { projectId: otherStore.getProjectId }
  })
}

/** 分页查询所属城市信息 */
export const highwayCityPageDataList = (params, data) => {
  return request.post({ url: BASEURL + '/highwayCity/pageDataList', params: params, data: data })
}
/** 新增或修改所属城市信息 */
export const highwayCitySaveOrUpdate = (data) => {
  return request.post({ url: BASEURL + '/highwayCity/saveOrUpdate', data: data })
}

/** 根据id删除所属城市信息 */
export const highwayCityDeleteById = (params) => {
  return request.post({ url: BASEURL + '/highwayCity/delete', params: params })
}

/** 查询路端系统信息 */
export const roadSystemDataList = () => {
  return request.post({
    url: BASEURL + '/roadSystem/dataList',
    params: { projectId: otherStore.getProjectId }
  })
}

/** 分页查询路端桩号信息 */
export const highwayRoadPilePageDataList = (params, data) => {
  return request.post({
    url: BASEURL + '/highwayRoadpile/pageDataList',
    params: params,
    data: data
  })
}

/** 根据id删除桩号信息 */
export const highwayRoadPileDeleteById = (params) => {
  return request.post({ url: BASEURL + '/highwayRoadpile/delete', params: params })
}

/** 新增或修改桩号信息 */
export const highwayRoadPileSaveOrUpdate = (data) => {
  return request.post({ url: BASEURL + '/highwayRoadpile/saveOrUpdate', data: data })
}

/** 分页查询设备资产列表信息 */
export const busFacilityPageDataList = (params, data) => {
  return request.post({
    url: BASEURL + '/busFacility/pageDataList',
    params: params,
    data: data
  })
}

/** 根据id删除设备资产信息 */
export const busFacilityDeleteById = (params) => {
  return request.post({ url: BASEURL + '/busFacility/delete', params: params })
}

/** 新增或修改设备资产信息 */
export const busFacilitySaveOrUpdate = (data) => {
  return request.post({ url: BASEURL + '/busFacility/saveOrUpdate', data: data })
}
